
#ifndef __NAND__PHY___H__
#define __NAND__PHY___H__

#include "nand_phy_api.h"
#include "spi_bus.h"

void nandphy_preinit(const struct nandphy_hook *hook,
			const struct spi_bus_ops *spi_ops);

u32 nandphy_get_param_len(void);

int nandphy_self_load_param(void *param0);

int nandphy_init(const struct nandphy_hook *hook,
			const struct spi_bus_ops *spi_ops,
			void *param0);

int nandphy_reinit(void);

u32 nandphy_get_freq_from_param(void *param);
u32 nandphy_get_freq(void);

u32 nandphy_get_param1_len(void);

int nandphy_init1(void *param1);

int nandphy_init2(void *param1);

int nandphy_store_all(void);

void nandphy_exit(void);

unsigned int nandphy_get_capacity(void);

unsigned int nandphy_get_page_size(void);

unsigned int nandphy_get_block_size(void);

unsigned int nandphy_get_oob_full_size(void);

unsigned int nandphy_get_oob_size(void);

int nandphy_read(long long offset, int len, void *buf);

int nandphy_read_oob(long long offset, void *buf);
int nandphy_write(long long offset, int len, void *buf);

int nandphy_erase_block(unsigned int block);
int nandphy_write_data(long long offset, int len, void *buf);

int nandphy_flush(void);
int nandphy_has_nftl_area(void);
#endif /* __NAND__PHY___H__ */
